Remove a key

del D[‘a’]

Remove a key from a dictionary.
D = {'a': 1, 'b': 2, 'c': 3, 'd': 4}
print(D)

if 'a' in D:
    del D['a']
print(D)

Output:

{'c': 3, 'b': 2, 'd': 4, 'a': 1}
{'c': 3, 'b': 2, 'd': 4}